<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>
        <h1 class="pull-right">
            <a href="<?php echo $this->url('delivery', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加配送方式'); ?></a>
            <?php echo $this->HelpUrl('deliveryList'); ?>
        </h1>
    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box shop-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="5%"><?php echo $this->translate('ID'); ?></th>
                                <th width="10%"><?php echo $this->translate('配送名称'); ?></th>
                                <th width="15%"><?php echo $this->translate('配送简介'); ?></th>
                                <th width="5%"><?php echo $this->translate('配送排序'); ?></th>
                                <th width="5%"><?php echo $this->translate('货到付款'); ?></th>
                                <th width="5%"><?php echo $this->translate('轨迹绑定'); ?></th>
                                <th width="5%"><?php echo $this->translate('状态'); ?></th>
                                <th width="8%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($this->deliveryList) foreach ($this->deliveryList as $dValue) { ?>
                                <tr>
                                    <td><?php echo $dValue->getDeliveryId(); ?></td>
                                    <td><?php echo $this->escapeHtml($dValue->getDeliveryName()); ?></td>
                                    <td><?php echo $this->escapeHtml($dValue->getDeliveryInfo()); ?></td>
                                    <td><?php echo $this->escapeHtml($dValue->getDeliverySort()); ?></td>
                                    <td><?php echo $dValue->getCashOnDelivery() == 1 ? $this->translate('支持') : $this->translate('不支持'); ?></td>
                                    <td><?php echo !empty($dValue->getDeliveryNameCode()) ? $this->translate('是') : $this->translate('否'); ?></td>
                                    <td><?php echo $this->adminHelper()->deliveryState($dValue->getDeliveryState()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('delivery',
                                            ['action'=>'edit', 'id'=>$dValue->getDeliveryId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>

                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该配送方式吗?'); ?>', '<?php echo $this->url('delivery', ['action'=>'delete', 'id'=>$dValue->getDeliveryId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </section>
</div>